package com.zzyl.controller.customer;

import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.dto.GetPageNursingsDto;
import com.zzyl.dto.GetPageWithNameAndStatusDto;
import com.zzyl.entity.NursingProject;
import com.zzyl.service.NursingProjectService;
import com.zzyl.vo.NursingProjectVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/customer/orders/project")///page
public class CustomerOrdersController {

    @Autowired
    private NursingProjectService nursingProjectService;
    @GetMapping("/page")
    public ResponseResult getOrdersProjectPage(GetPageNursingsDto dto){
        PageResponse<NursingProjectVo> page = nursingProjectService.page(dto);
        return ResponseResult.success(page);
    }
    @GetMapping("/{id}")
    public ResponseResult getOrdersProjectById(@PathVariable Integer id){
        NursingProject nursingProjectById = nursingProjectService.getNursingProjectById(id);
        return  ResponseResult.success(nursingProjectById);

    }
}
